package com.itr.kbm.model;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table (name = "LISTADMIN")
@DynamicInsert
@DynamicUpdate
public class ListAdmin extends BaseObject{

	/**
	 * 
	 */
	private static final long serialVersionUID = 9L;
	private int id;
	private String kodeAdmin;
	private String namaAdmin;
	private String password;
	
	public ListAdmin(){}
	public ListAdmin(int id, String kodeAdmin, String namaAdmin, String password) {
		this.id = id;
		this.kodeAdmin = kodeAdmin;
		this.namaAdmin = namaAdmin;
		this.password = password;
	}
	@Id
	@Column(name = "ID")
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name = "KODEADMIN")
	public String getKodeAdmin() {
		return kodeAdmin;
	}
	public void setKodeAdmin(String kodeAdmin) {
		this.kodeAdmin = kodeAdmin;
	}
		
	@Column(name = "NAMAADMIN")
	public String getNamaAdmin() {
		return namaAdmin;
	}
	public void setNamaAdmin(String namaAdmin) {
		this.namaAdmin = namaAdmin;
	}
	
	@Column(name = "PASSWORD")
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		result = prime * result
				+ ((kodeAdmin == null) ? 0 : kodeAdmin.hashCode());
		result = prime * result
				+ ((namaAdmin == null) ? 0 : namaAdmin.hashCode());
		result = prime * result
				+ ((password == null) ? 0 : password.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ListAdmin other = (ListAdmin) obj;
		if (id != other.id)
			return false;
		if (kodeAdmin == null) {
			if (other.kodeAdmin != null)
				return false;
		} else if (!kodeAdmin.equals(other.kodeAdmin))
			return false;
		if (namaAdmin == null) {
			if (other.namaAdmin != null)
				return false;
		} else if (!namaAdmin.equals(other.namaAdmin))
			return false;
		if (password == null) {
			if (other.password != null)
				return false;
		} else if (!password.equals(other.password))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "ListAdmin [id=" + id + ", "
				+ (kodeAdmin != null ? "kodeAdmin=" + kodeAdmin + ", " : "")
				+ (namaAdmin != null ? "namaAdmin=" + namaAdmin + ", " : "")
				+ (password != null ? "password=" + password : "") + "]";
	}

	
}
